Process and device for detection of drops in a digital image and computer program for executing this method

ABSTRACT

A method for detection of drops on a transparent wall through which digital images (I 11 -I 15 ,I 111 -I 115 ,I 211 -I 215 ,I 311 -I 315 ) are acquired by means of an image acquisition system, comprising the following steps:
     b) a gradient image is established from the digital image (I 16 ) by assigning to each pixel the value of the gradient for the pixel;   c) the gradient image is filtered by assigning to each pixel a value obtained by rank filtering;   d) a mask representing the position of the detected drops in the digital image is established by activating the pixels for which the difference between the value of the pixel in the filtered image and the value of the pixel in the gradient image exceeds a predetermined value.   

     This method enables robust detection of drops in the image or the sequence of images. 
     Program and device for detection of drops for executing this method.

The present invention relates to a method, a computer program and adevice for the detection of drops in a digital image or from a pluralityof digital images.

The need to detect drops in digital images comes up in differentapplications. This need can first be in industrial processes, where itis necessary or important to determine whether there is condensation andformation of drops during the process. Another important application isdriving a vehicle. When a vehicle is travelling, when it is raining, itswindscreen gets covered in drops. It is understood that when rain startsto fall it can be interesting to take this change into account bydetecting the presence of drops, whether to automatically activate awindscreen wiper, or to transmit information to the control system ofthe vehicle and adapt the performance of the latter to the rainsituation which has been detected.

More generally, the detection of drops in an image can be important inany method which implements digital images, likely to be troubled orperturbed by the presence of drops in the image. For example, videosurveillance systems can be improved by means of methods for imageprocessing integrating a step of detection of drops in the image,followed by a step of correction of the image.

As is known, rain detectors, whereof the sole function is to detectdrops (or rain), and constituted mainly by an infrared transmittercoupled to a detector, are used on board vehicles as drop detectiondevices. This assembly is arranged attached to the windscreen. Thetransmitter sends infrared radiation in the direction of the windscreen,and the detector receives the signal sent back by the latter. If thereis a drop of water on the outer face of the windscreen, the latterreflects some of the infrared radiation and this reflection can bedetected.

Although these are generally reliable, they do have some disadvantages.First, the detection of drops is made possible only on a small sectionof the windscreen. Next, these sensors do not provide quantitativeinformation on the number of drops deposited on the windscreen. Finally,these sensors are usually placed in the vehicle interior at the level ofthe central rear-view mirror, and occupy a space taken by numerousapplications embedded on board the vehicle. Also, a method for detectingdrops in an image is presented by the publication ‘Rainy WeatherRecognition from In-vehicle Camera Images for Driver Assistance’, by MM. Kurihata et al., Intelligent Vehicles Symposium, IEEE, pp. 205-210,2005.

This publication presents a method for detecting drops in a digitalimage. This method comprises a previous static learning phase in whichanalysis of principal components enables learning of characteristics ofdrops, from a large database. The method as such is then implementedduring a matching phase, during which image parts are matched or atleast are compared to reference images to identify drops.

This system provides good results essentially only against a relativelyunited background, for example an image of the sky. However, it lacksrobustness at a complex level, for example an image representing anurban environment.

A first aim of the invention is therefore to propose a robust method forthe detection of drops appearing in a digital image acquired through atransparent wall by means of an image acquisition system; a methodallowing not only detection of the presence of drops, but also theposition of the latter.

This aim is attained due to the method for detecting drops comprisingthe following steps:

-   b) a gradient image is established from said digital image, by    assigning to each pixel the value of the gradient at the position of    the pixel;-   c) said gradient image is filtered to obtain a filtered image, by    assigning to each pixel a value obtained by applying a rank filter    to a neighbourhood of the pixel;-   d) a mask representing the position of the detected drops in said    digital image is determined, in which mask the pixels for which the    difference between the value of the pixel in the filtered image and    the value of the pixel in the gradient image exceeds a predetermined    value are activated.

‘Mask’ is understood as a binary image, whereof the pixels are equal toeither 0 (deactivated pixel), or 1 (activated pixel). The imageacquisition system can be especially a photo camera or a digital videocamera.

The method comprises two steps b) and c) for preparation of intermediateimages, the gradient image and the filtered image, from which theinformation relative to the presence of drops is extracted, during stepd) for creation of the mask.

For each pixel of the filtered image, the step of rank filteringconsists in determining for a predetermined neighbourhood of the pixel(for example, a box of 15×15 pixels or 21×21 pixels centered on theconsidered pixel), the value below which there is a predeterminedfraction (percentage) of the pixels, and correlatively above which thereis a complementary predetermined fraction of the pixels. For example,the aim is to determine the value below which 95% of the pixels of theconsidered neighbourhood are found. This value is assigned to theconsidered pixel, in the filtered image.

The filtered image is an image in which the local ‘noise’ of thegradient image is reduced. A neighbourhood size substantially largerthan the size of a drop is preferably selected, for example, triple orquadruple the size of a drop in both directions.

Also, subtracting the filtered image from the gradient image allows thevariations in gradient due to the drops to be visible.

The result is considerable robustness for the method, allowing thelatter to give good performance, including for images representingcomplex scenes, for example an urban environment.

A second aim of the invention is to propose a robust method fordetection of drops from a plurality of digital images, allowing thedetection of drops appearing in a plurality of digital images acquiredthrough a transparent wall by means of an image acquisition system.

This aim is attained due to the method comprising the following steps:

-   -   a plurality of masks is obtained successively from said digital        images by the method defined previously;    -   during a step h), a confirmed mask containing the drops        appearing in at least one predetermined proportion of the        resulting masks is set up. One understands that, in this method,        the plurality of digital images from which the method is        implemented can be exploited in different ways, specifically:    -   by calculating a mask for each of the digital images; or    -   by forming in the plurality of images groups of digital images,        wherein a mask is obtained for each of these groups, the        confirmed mask being then obtained on the basis of these masks.

A third aim of the invention is to propose a computer program, which canbe executed on a computer or a calculator so as to detect drops in adigital image or a plurality of digital images provided to the programas start (input) data.

This aim is attained due to the computer program comprising instructionsfor executing one of the methods for detection of drops as definedpreviously.

A fourth aim of the invention is to propose a device for detection ofdrops for detecting the presence of drops in the image robustly, andable to be carried out by means of a standard image acquisition system.

This aim is attained due to the device comprising an image acquisitionsystem and a calculator connected to the latter for receiving the imagesacquired by the image acquisition system, the calculator being suitablefor executing the method defined previously. In particular, theinvention concerns devices of this type used as devices for detection ofdrops of rain on a windscreen. Calculator here means either a computer,or a dedicated electronic component, especially a component whereof thephysical architecture (hardware) executes some functions which can alsobe performed by software.

So, the invention especially concerns a device comprising an imageacquisition system, and such a calculator connected to the latter forreceiving the images acquired by the image acquisition system;

-   said calculator comprising:    -   means for establishing a gradient image from said digital image,        suitable for assigning to each pixel the value of the gradient        at the position of the pixel to constitute the gradient image;    -   filtering means suitable for constituting a filtered image by        assigning to each pixel a value obtained by applying a rank        filter to a neighbourhood of the pixel in the gradient image;    -   means for establishing a mask representing the position of the        detected drops in said digital image, in which mask the pixels        for which the difference between the value of the pixel in the        filtered image and the value of the pixel in the gradient image        exceeds a predetermined value are activated.

The calculator can mainly comprise a central unit, but can also bearranged with several distributed calculation units.

In an embodiment, the calculator further comprises means for completingthe mask by activating therein non-activated pixels located betweenneighbouring activated pixels.

In an embodiment, the calculator further comprises means for refiningthe mask by deactivating therein groups of activated connected pixelsfulfilling at least one predetermined criterion of elimination relatingto a property of the group of connected pixels.

In an embodiment, the calculator further comprises means for identifyingdrops in the mask obtained, each drop corresponding to a group ofactivated connected pixels.

The invention especially concerns a device such as described previously,arranged to successively produce a plurality of masks from digitalimages, and wherein the calculator further comprises mask confirmationmeans, suitable for selecting in a mask (called ‘confirmed’ mask) thedrops appearing at least in a predetermined proportion of the previouslyobtained masks.

In an embodiment, the device further comprises transmission means fortransmitting a control signal to a machine, said signal being a functionof the number or density of drops identified on the digital image or thedigital images. Density of drops here designates the ratio between thenumber of identified drops and the surface of the glass pane on whichthe drops have been detected (the density can be expressed as a numberof drops/m²), or the ratio between the identified drops and the surfaceexpressed in pixels of one or more regions of interest in the image (thedensity can be expressed as a number of drops/pixel or number ofdrops/MPixels).

This type of device can be made especially to transmit a control (oractivation) signal to a window wiper system.

The invention will be more clearly understood and its advantages willemerge more clearly from the following detailed description ofembodiments represented by way of non-limiting examples. The descriptionrefers to the attached diagrams, in which:

FIGS. 1 and 2 illustrate respectively an initial image from which themethod according to the invention is executed, and a final imageobtained by showing the detected drops in black;

FIG. 3 is a perspective view of a device according to the inventionarranged in a vehicle;

FIG. 4 is a schematic ensemble view of a method for detecting dropsaccording to the invention;

FIG. 5 is a representation of a partial digital mean image obtained froma set of digital images (step a) of the method);

FIG. 6 is a representation of a digital gradient image obtained from theimage of FIG. 5 (step b) of the method);

FIG. 7 is a representation of a digital filtered image obtained from theimage of FIG. 6 by rank filtering (step c) of the method);

FIG. 8 is a representation of a mask obtained by subtraction andthresholding from the images of FIGS. 6 and 7 (step d) of the method);and

FIG. 9 is a representation of a confirmed mask obtained from the mask ofFIG. 5 (step h) of the method).

FIGS. 1 to 3 presents an important application of the invention,specifically the detection of drops on the windscreen of a vehicle.

FIGS. 1 and 2 illustrate digital images obtained by means of a devicefor detection of drops 100 represented in FIG. 3.

FIG. 1 illustrates a raw image, such as provided by the camera. FIG. 2illustrates an image formed on completion of the method, by superposingon the raw image the mask obtained by means of the method. The pixels ofthe detected drops appear in black. Advantageously this second imageenables instant evaluation of the number and density of drops present onthe windscreen.

FIG. 3 presents schematically the device 100 for detection of dropsaccording to the invention used to produce this result. Installed in avehicle 102, this device 100 comprises a camera 104, placed in thevehicle interior 106, and a calculator 108 or onboard computer to whichthe camera 104 is connected. The camera 104 is infinite-focussed toprovide a clear image of the landscape. Because of infinite focussing,obtaining clear images of the environment of the vehicle contributes tothe efficacy of image processing performed by the calculator 108(processing defined hereinbelow). On the contrary, a camera which wouldbe focussed on the windscreen and not providing clear images of theenvironment would not produce the desired efficiency for the detectionof drops.

Also, infinite focussing of the camera produces clear images of theenvironment of the vehicle: these images can be exploited for otheruseful processing, such as detection of the road signs, etc.

A program according to the invention, which executes the method fordetecting drops from images acquired successively by the camera, isexecuted on the calculator 108.

The calculator 108, as a function of the information obtained as to thepresence of drops on the windscreen, activates an electric motor 109which actuates windscreen wipers 110 when necessary.

In reference to FIGS. 4 to 9, an embodiment of the method for detectingdrops according to the invention will now be described. FIG. 4illustrates a schematic ensemble view of the method, whereas FIGS. 5 to9 respectively illustrate steps a) to e) of the latter.

The method is executed from a sequence of digital images produced by astandard digital video camera such as CCD or CMOS matrix video camera.

This sequence of images is organised into groups of images. These groupsof images can be configured in different ways: either withoutoverlapping between the groups, as in the example which will be detailedhereinbelow, or with overlapping between the groups, signifying thatimages can be common to two groups or even more. For example, if imagesI1, I2, I3, I4, etc. are acquired continuously by a camera, the groupsof images can be constituted as follows: The first group can contain theimages I1 to I5, the second group the images I2 to I6, the third groupthe images I3 to I7, etc.

In the embodiment illustrated by FIGS. 4 to 9, a sequence of 20 imagesI11 to I15, I111 to I115, I211 to I215, I311 to I315 is shown.

Initially, the images are grouped by groups of five images (this couldbe any whole number in place of five): This constitutes therefore fourgroups of images I11 to I15, I111 to I115, I211 to I215, I311 to I315.

For each of these groups, the first step a) of the method consists indetermining a mean image from the digital images of the group. So, fromimages I11 to I15 the mean image I16 is formed; from images I111 to I115the mean image I116 is formed, etc. In each mean image, each pixel isassigned the mean value assigned to the pixel in the images of theconsidered group of images.

In the case where the images I11-I15, I111-I115, etc. are colour imagesthe mean image is transformed into a grey image.

A suite of operations (steps b) to g) of the method) is then carried outwhich produces a mask (I20, I120, I220, I320) for each of the resultingmean images. These masks are binary images in which the pixels on whichthe presence of a drop has been detected are activated (that is, takethe value 1).

FIGS. 5 to 9 illustrate the digital images obtained during steps a) toe) of the method. For better understanding, these steps of the methodare illustrated by way of partial images comprising only 18 lines and 27columns. Naturally, the complete images usually have larger dimensions,for example 480 lines and 640 columns.

Unless otherwise specified, the following explanation is given forprocessing made from images I11-I15.

As already mentioned, during the initial step a) of the method (FIG. 5)a plurality of digital images is averaged, in this case images I11-I15,so as to obtain a mean image I16 which forms the digital image on thebasis of which the following steps of the method are carried out.

FIG. 5 illustrates the mean image I16, obtained by calculating pixel bypixel the mean of images I11 to I15. The determination of the value of apixel in the mean image can be done with different known formulas forcalculating a mean value of a pixel among several images.

The digital image illustrated by FIG. 5 illustrates a landscape with afirst dark area 60 (the road) at the bottom, followed immediately aboveby a second area 62 in medium grey; followed by a third area 64 andfinally by a fourth area 66 (the sky, light).

This image is altered by the presence of four drops A, B, C, D. Each ofthese drops occupies an area of dimensions of 3×4 pixels. The dropsrepresent in a reversed direction the hues of the scene they reflect:That is, they comprise dark pixels towards the top, and light pixelstowards the bottom, inversely to the landscape reflected (areas 60, 62,64, 66).

The following step b) of the method (FIG. 6) consists in establishing agradient image I17 from the mean image I16.

To establish the image I17, first a first gradient image ‘en X’ isformed in which each pixel takes the value determined by means of thefollowing formula:

G _(x)(x,y)=|I ₁₆(x,y)−I ₁₆(x−1,y)|

in which | . . . | represents the absolute value function, and I₁₆(x,y)is the value taken by the pixel of the line x and the column y in theimage I16. A first gradient image ‘in Y’ is calculated similarly, as:

G _(y)(x,y)=|I ₁₆(x,y)−I ₁₆(x,y−1)|.

The gradient image I17 is obtained by assigning to each pixel the value:

G(x,y)=√(G _(x)(x,y)² +G _(y)(x,y)²)

in which √ represents the function ‘square root’. Other similarfunctions of gradient can be used within the scope of the invention.

Naturally, it is the variations in hue which appear in the gradientimage I17. Three horizontal bands 68,70,72 can thus be identified,having a width of two pixels. These correspond to the respectivevariations in hue between the areas 60, 62, 64 and 66.

Also, for each drop two areas 74A, 76A, 74B, 76B, 74C, 76C, 74D, 76D canbe identified, which correspond respectively to the upper and lowerparts of the drops A, B, C, D. Since the image is more contrasted in itslower part, one can note that the gradient values of drops C and D arehigher than those of drops A and B; the result is that the areas 74C,74D and 76C, 76D of the drops C and D are darker than the correspondingareas of the drops A and B.

The following step c) of the method (FIG. 7) consists in filtering thegradient image I17 to obtain a filtered image I18, by assigning to eachpixel a value obtained by rank filtering. As is known, rank filteringconsists in assigning to each pixel the value below (or above) whichthere is a given percentage of values of the pixels located in aneighbourhood of the considered pixel. The presented method has beenvalidated especially by assigning to each pixel of the filtered imagethe value below which there is 95% of pixels in a neighbourhoodconstituted by a box of 15×15 or 21×21 pixels.

In the filtered image I18, a lower dark area 78 and an upper lighterarea 80 can be identified. The lower area 78 results essentially fromthe presence of the dark areas 68, 70, 74C 76C, 74D and 76D in thegradient image I17.

The following step d) of the method (FIG. 8) consists in establishing amask I19 representing the position of the detected drops. This is donein two steps. Initially, an image is formed by subtraction between thegradient image I17 and the filtered image I18.

Next, the mask I19 is established by a thresholding operation, byactivating therein only those pixels for which the difference betweenthe value of the pixel in the filtered image and the value of the pixelin the gradient image exceeds a predetermined value. The mask I19 can beconsidered as a ‘high-gradient image’.

In this mask I19, areas 84A, 86A, 84B, 86B, 84C, 86C, 84D, 86D, can beidentified, corresponding respectively to the upper and lower groups ofactivated connected pixels, for the drops A, B, C and D.

The interest of the method is that the different gradient areas (74A,76A, 74B, 76B, 74C, 76C, 74D, 76D) are effectively detected andactivated in the mask I19. This is permitted by the subtractionoperation of the filtered image from the gradient image at step d),which leads to remove a local component from the value of the gradient.If only gradient type functions had been used for detecting the positionof the drops in the image, this result could not have been obtained.

Indeed, undertaking the thresholding operation of the gradient image I17with a threshold having the value of area 78 (corresponding to areas74C, 76C, 74D and 76D) does not enable detection of drops A and B: Withsuch a threshold value, areas 84A, 86A, 84B and 86B do not appear in thethresholded image. Inversely, undertaking the thresholding operation ofthe gradient image I17 with a threshold having the value of area 80(corresponding to areas 74A, 76A, 74B and 76B), would have retained, inaddition to drops A, B, C and D, areas 70 and 68, without making itpossible to distinguish the latter from drops C and D.

Consequently, using the filtered image I18 during steps c) and d)advantageously makes it possible to identify in the gradient image I17the four drops A, B, C and D, and only them.

The following step e) of the method (FIG. 9) consists in completing themask by activating therein non-activated pixels located betweenneighbouring activated pixels.

The aim of this step is to fulfil the ‘holes’ in the mask so as to allowareas of neighbouring activated pixels, corresponding in fact todifferent parts of the same drop present in the image, to be identifiedas one and the same drop.

In the expression, “located between neighbouring activated pixels”, theterm “between” must be considered as having a broad meaning. In fact,step e) consists in activating pixels when they are surrounded orencircled (at least partially) by activated pixels. This step moreprecisely consists in activating each of the pixels which fulfil anactivation criterion, this activation criterion being a function of thenumber, distance and/or position of the activated pixels located nearthe considered pixel.

The neighbourhood of the considered pixel can be defined in differentways and as a function of the selected activation criterion.

In an embodiment, this neighbourhood contains all the pixels close tothe considered pixel, that is, all the pixels remote by a distance ofless than the size of a drop in the image (optionally, the maximal sizeof a drop), or a fraction of this distance. The activation criterionconsists in activating all the pixels which at least have apredetermined number of activated pixels in this neighbourhood.

In other embodiments, the form and the size of the neighbourhood can bespecified.

For example, it is possible to use as neighbourhood the four pixelsabove and below the considered pixel. As in the preceding embodiment,the activation criterion in this case consists in activating the pixelswhich have at least a predetermined number of activated pixels in theirneighbourhood (defined that way). In the example illustrated by thefigures, two activated pixels at a minimum must be in the neighbourhoodof a considered pixel to allow activation of the latter. The image I20illustrates this function applied to image I19.

An example of a mask completed in this way is given in FIG. 9 whichshows four areas of activated connected pixels, corresponding to thefour detected drops A, B, C, and D.

The following step f) of the method consists in refining the mask bydeactivating therein groups of activated connected pixels fulfilling atleast one predetermined elimination criterion, relating to a property ofthe group of connected pixels. The aim of this step is to eliminate fromthe mask any groups of activated connected pixels which would notcorrespond to drops present on the windscreen. This is based on thephysical properties of liquids which cause the size of drops to varywithin fixed minimal and maximal limits, as well as the elongation ofdrops or their eccentricity.

Different elimination criteria can therefore be used (optionallysimultaneously). In the presented example, the following criteria areused simultaneously:

-   -   a first elimination criterion is fulfilled if and only if the        number of pixels of the group of activated connected pixels is        less than a first predetermined value and/or greater than a        second predetermined value (this is therefore a criterion        relating to the surface of the drop);    -   a second elimination criterion is fulfilled if and only if the        ratio between the height and the width of the group of activated        connected pixels is less than a third predetermined value and/or        greater than a fourth predetermined value;    -   a third elimination criterion is fulfilled if and only if the        eccentricity of the group of activated connected pixels is less        than a predetermined value. The eccentricity is defined in the        embodiment illustrated as the ratio between the square of the        perimeter and the surface, but other definitions can be used.

The following step g) of the method consists in identifying drops in themask obtained, each drop corresponding to a group of activated connectedpixels. The aim of this step is to discretise the information, and tosupply the information on the drops present in the image in the form ofa list of drops. Preferably, some information is extracted for eachdrop, such as for example the position of the drop in the image (lineand column numbers). Naturally, the position of the drop can be definedin different ways, for example its barycentre, by a median point, etc.For each drop different geometric variables, such as surface, perimeter,etc. can also be calculated.

This information can optionally be exploited from this stage of themethod.

However, before this information is exploited, it is preferable torefine it or purify it by eliminating some of the drops identifiedduring the preceding steps, since it is clear that these are in factartefacts and not drops.

For this, the method comprises a following step h) which consists infurther refining the information obtained by producing a ‘confirmed’mask I21. This step h) is based on the knowledge that a drop generallyremains at a constant position on the surface where it is located; also,it must be detected at this position on all or at least on a majority ofthe images. This principle is naturally particularly efficient in thecase of drops formed on a windscreen of a moving vehicle, since bycontrast the values of the pixels featuring elements of the landscapechange constantly.

On the basis of this principle, the confirmed mask I21 is determined byretaining in this mask only the drops appearing at least in apredetermined proportion of the previously obtained masks I20, I120,I220, I320. In this case, the criterion selected for retaining a drop inthe confirmed mask I21 consists in requiring that the drop be detectedin 100% of the masks obtained during the preceding steps.

Now, in the example presented, three of the drops have beensystematically detected in the four masks I20-I320 obtained, but one ofthe drops (that located at the top right of the images, drop ‘B’ inFIGS. 5 to 9) has not been detected or retained in the mask I320. Itfollows that this drop ‘B’ is eliminated from the confirmed mask I21(FIG. 4).

In practice, in the method as presented, this requirement is verified asfollows:

-   -   the position of the median points of all the detected drops is        determined, in each of the masks studied (I20-I120-I220-I320);    -   for any drop present in the first mask (I20) of the series of        masks studied, it is verified that in each of the masks obtained        in subsequent steps (I120-I220-I320), there is at least one drop        whereof the median point is far from that of the drop studied by        a predetermined distance. If this property is verified for each        of the masks obtained in subsequent steps, the drop is conserved        in the confirmed mask (I21); in the opposite case, it is        considered as an artefact and is deleted, and the corresponding        pixels of the mask I21 are deactivated.

Once the confirmed mask I21 is obtained, the information relative to thedetected drops, produced during step g) of the method (position,surface, perimeter, etc., of the detected drops) is updated, whererequired.

Next, from the confirmed mask I21, the total number 88 of detected dropsis evaluated, each drop therefore corresponding to a group of activatedconnected pixels. In the example presented, forty drops have beendetected on the entire image of FIG. 1.

Finally, in a step i) of the method, a control signal is sent to amachine, said signal being a function of the number or density of dropsidentified in the preceding step (this number can have decreasedrelative to its initial value during the mask confirmation step).

It can be understood that according to the case the informationtransmitted can be either the number of drops itself, or the density ofdrops, obtained by dividing, over different regions of interest, thenumber of drops by the area of the region of interest, or a binaryabsence/presence indication of drops or rain. In this latter case, acriterion is selected to move the value of the indicator to 1; forexample, it can be considered to be raining (presence of drops) when thenumber of drops is greater than a predetermined number.

In the application presented by the figures, the information of thenumber of drops is transmitted to the electronic control unit 108. Thelatter deduces whether it is necessary or not to activate the windscreenwipers 110 or optionally to adapt the speed and/or the sweepingfrequency of the latter. In this case, on receipt of the informationaccording to which forty drops are on the windscreen, the control unit108 activates the windscreen wipers, and transmits an actuation commandto an electric motor 109 which then activates the windscreen wipers 110.The control unit 108 connected to the electric motor 109 and to thewindscreen wipers 110 constitutes a window wiper system.

The method presented by the embodiment is characterised by the use of asequence of images, which makes it possible first to determine meanimages I16-I116-I216-I316, then to obtain masks I20-I120-I220-I320, andfinally to obtain a confirmed mask I21. Naturally, the method accordingto the invention can be carried out from a single image; it can also becarried out so as to calculate a mask for each of the starting imagesI11-I15, I111-I115, I211-I215, I311-I315; it can also be carried out byfirst averaging the set of images of the sequence I11-I15, I111-I115,I211-I215, I311-I315, but without confirmation of the mask during stageh) of the method in this case.

1. A method for detection of drops appearing in a digital image acquiredthrough a transparent wall by means of an image acquisition system, themethod comprising the following steps: b) a gradient image isestablished from said digital image, by assigning to each pixel thevalue of the gradient at the position of the pixel; c) said gradientimage is filtered to obtain a filtered image, by assigning to each pixela value obtained by applying a rank filter to a neighbourhood of thepixel; d) a mask is established representing the position of thedetected drops in said digital image, in which mask the pixels for whichthe difference between the value of the pixel in the filtered image andthe value of the pixel in the gradient image exceeds a predeterminedvalue are activated.
 2. The method as claimed in claim 1, furthercomprising the following step: e) the mask is completed by activatingtherein non-activated pixels, located between neighbouring activatedpixels.
 3. The method as claimed in claim 1, further comprising thefollowing step: f) the mask is refined by deactivating therein groups ofactivated connected pixels fulfilling at least one predeterminedcriterion of elimination, relating to a property of the group ofconnected pixels.
 4. The method as claimed in claim 3, in which acriterion of elimination taken into account at step f) is fulfilled ifand only if the number of pixels of the group of activated connectedpixels is less than a first predetermined value and/or greater than asecond predetermined value.
 5. The method as claimed in claim 3, inwhich a criterion of elimination taken into account at step f) isfulfilled if and only if the ratio between the height and the width ofthe group of activated connected pixels is less than a thirdpredetermined value and/or greater than a fourth predetermined value. 6.The method as claimed in claim 3, in which a criterion of eliminationtaken into account at step f) is fulfilled if and only if theeccentricity of the group of activated connected pixels is less than apredetermined value.
 7. A method for detection of drops from a pluralityof digital images, following which in an initial step a) said pluralityof digital images is averaged so as to obtain a mean image which formsthe digital image on the basis of which the method as claimed in claim 1is carried out.
 8. The method for detection of drops as claimed in claim1, further comprising the following step: g) drops in the mask obtainedare identified, each drop corresponding to a group of activatedconnected pixels.
 9. A method for detection of drops appearing in aplurality of digital images acquired through a transparent wall by meansof an image acquisition system, the method comprising the followingsteps: a plurality of masks is established successively from saiddigital images by the method defined by claim 8; during a step h) aconfirmed mask is established containing the drops appearing in at leastone predetermined proportion of masks obtained in this way.
 10. Themethod for detection of drops as claimed in claim 8, comprising furtherthe following step: i) a control signal is sent to a machine, saidsignal being function of the number or of the density of dropsidentified at step g), especially in the case where the machine is awindow wiper system.
 11. A computer program comprising instructions forexecuting a method for detecting drops as claimed in claim
 1. 12. Adevice for detection of drops, comprising an image acquisition systemand a calculator connected to the latter for receiving images acquiredthrough a transparent wall by the image acquisition system, thecalculator being suitable for executing the method as claimed inclaim
 1. 13. The method for detection of drops as claimed in claim 7,further comprising the following step: g) drops in the mask obtained areidentified, each drop corresponding to a group of activated connectedpixels.
 14. A computer program comprising instructions for executing amethod for detecting drops as claimed in claim
 7. 15. A device fordetection of drops, comprising an image acquisition system and acalculator connected to the latter for receiving images acquired througha transparent wall by the image acquisition system, the calculator beingsuitable for executing the method as claimed in claim 7.